package com.gitee.wordcount

import org.apache.flink.api.scala.ExecutionEnvironment

object WordCount {
  def main(args: Array[String]): Unit = {
    val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment
    import org.apache.flink.api.scala._
    val lineData: DataSet[String] = env.fromElements("The Apache Flink community released the third bugfix version of the Apache Flink 1.8 series.Running Apache Flink on Kubernetes with KUDO A common use case for Apache Flink is streaming data analytics together with Apache Kafka, which provides a pub/sub model and durability for data streams.","In this post, we demonstrate how to orchestrate Flink and Kafka with KUDO")
    val wordData: AggregateDataSet[(String, Int)] = lineData.flatMap(_.split(" ")).map((_, 1)).groupBy(0).sum(1)
    env.setParallelism(1)
    wordData.print()
  }
}
